package com.example.flow.pipeline.core;

import com.example.flow.pipeline.model.result.FlowResult;

/**
 * @Desprication: Valve接口通用抽象
 * @Author: YangBin
 * @Date: created in 13:59 2020/3/2
 * @Modify By:
 */
public abstract class AbstractValve implements Valve {

    private final String name;
    private final DefaultPipeline pipeline;

    protected AbstractValve(String name, DefaultPipeline pipeline) {
        this.name = name;
        this.pipeline = pipeline;
    }

    volatile AbstractValve next;
    volatile AbstractValve prev;

    @Override
    public String name() {
        return name;
    }

    @Override
    public PipeLine pipeline() {
        return pipeline;
    }

    @Override
    public FlowResult<?> execute() {
        throw new UnsupportedOperationException();
    }

}
